# 设置自动生成MOC文件 OBJECT==>CPP
set(CMAKE_AUTOMOC ON)

# 处理qrc文件
set(CMAKE_AUTORCC ON)

# Qt库
set(QT_VERSION 5)
set(REQUIRED_LIBS Core Widgets)
set(REQUIRED_LIBS_QUALIFIED Qt5::Core Qt5::Widgets)

#扫描 *.cpp *.h 文件
file(GLOB SOURCE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp")
file(GLOB HEADER_FILES "${CMAKE_CURRENT_SOURCE_DIR}/*.h")
# Compile target
add_executable(BaseWidgets ${SOURCE_FILES} ${HEADER_FILES} ${RESOURCES})

find_package(Qt${QT_VERSION} COMPONENTS ${REQUIRED_LIBS} REQUIRED)
target_link_libraries(BaseWidgets ${REQUIRED_LIBS_QUALIFIED})
